<template>
  <div class="content">
    <div class="header-box">
      <img src="../assets/images/home_img1.png" alt="">
      <Header></Header>
      <div class="header-login" v-if="Object.keys(userlist).length ==0">
        <router-link to="/login">
          登录
        </router-link>
        <a @click="goRegister">免费注册</a>
      </div>
      <div v-else class="header-login">
        <YsDropdown>
          <a href="javascript:void(0)">
            <YsAvatar :src="require('../assets/images/userimg.png')" />
            <span class="md-10">{{userlist.user_cn_name}}</span>
          </a>
          <YsDropdownMenu slot="list">
            <YsDropdownItem @click.native="$router.go(-1)">返回</YsDropdownItem>
            <YsDropdownItem @click.native="setSession">退出</YsDropdownItem>
          </YsDropdownMenu>
        </YsDropdown>
      </div>
    </div>
    <div class="wrapper-main">
      <Banner></Banner>
      <Product></Product>
    </div>
    <div class="wrapper-footer">
      <Footer></Footer>
      <div class="after-line">
        <div class="after-filing">
          <!-- <p>2018北京远舢智能科技有限公司京公网安备 11010502036687号</p> -->
          <p>中国特种设备检测研究院</p>
          <div class="after-icon">
            <span>分享至</span>
            <img src="../assets/images/qq.png" alt="">
            <img src="../assets/images/weixin.png" alt="">
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { ys_utils } from 'ys-utils-js';
import Header from '@/components/HomePage/Header.vue'
import Banner from '@/components/HomePage/Banner.vue'
import Product from '@/components/HomePage/Product.vue'
import Footer from '@/components/HomePage/Footer.vue'
export default {
  name: '',
  components: {
    Header,
    Banner,
    Product,
    Footer
  },
  data() {
    return {
      userlist: {}
    }
  },
  created() {
    this.userlist = ys_utils.getSessionStorage('CommData') && JSON.parse(ys_utils.getSessionStorage('CommData')) || {};
  },
  methods: {
    setSession() {
      ys_utils.clearSessionStorage('userInfo')
      this.userlist = {}
    },
    GetPutrouter() {

    },
    goRegister() {
      this.$router.push({
        name: 'register',
      });
    },
    leave() {
      this.menuList[this.isHowIndex].isHow = false
    },
    enter(v) {
      this.isHowIndex = v
      this.menuList[v].isHow = true
    },
    // 搜索
    queryRet() {


    },
  },
  mounted() {

  },
  watch: {

  },
  computed: {

  },
  filters: {

  }
}
</script>

<style scoped lang='less'>
.content {
  width: 100%;
  // height: 100%;
  overflow: hidden;

  .header-box {
    width: 100%;
    height: 79px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    position: fixed;
    z-index: 9999;
    /deep/.ivu-dropdown {
      height: auto;
    }
    .md-10 {
      margin-left: 6px;
    }
    img {
      width: 118px;
      height: 42px;
      margin-left: 33px;
      margin-right: 100px;
    }
    .header-login {
      display: flex;
      align-items: center;
      margin-left: auto;
      a {
        display: block;
        font-size: 18px;
        font-family: PingFang SC;
        font-weight: 400;
        padding: 0 30px;
        height: 79px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
        &:hover {
          background: linear-gradient(314deg, #0073d5 0%, #469be3 100%);
        }
      }
    }
  }
  .wrapper-main {
    width: 100%;
  }
  .wrapper-footer {
    margin-top: 70px;
    overflow: hidden;
    background: linear-gradient(314deg, #0073d5 0%, #469be3 100%);
    .after-line {
      border-top: 1px solid rgba(255, 255, 255, 0.14);
      .after-filing {
        width: 1200px;
        height: 65px;
        margin: 0 auto;
        display: flex;

        justify-content: space-between;
        align-items: center;
        p {
          color: #ffffff;
          opacity: 0.35;
        }
        .after-icon {
          display: flex;
          justify-content: space-between;
          align-items: center;
          span {
            color: #ffffff;
            opacity: 0.35;
            margin-right: 6px;
          }
          img {
            margin-left: 10px;
          }
        }
      }
    }
  }

}
</style>